package cn.jeefast.modules.platform.service.impl;

import cn.jeefast.common.entity.MbResearch;
import cn.jeefast.common.utils.R;
import cn.jeefast.modules.platform.dao.MbResearch1Dao;
import cn.jeefast.modules.platform.service.MbResearch1Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 研究组表 服务实现类
 * </p>
 *
 * @author theodo
 * @since 2020-01-06
 */
@Service
public class MbResearch1ServiceImpl extends ServiceImpl<MbResearch1Dao, MbResearch> implements MbResearch1Service {

    @Autowired
    private MbResearch1Dao researchDao;

    /**
     * 添加或编辑研究组信息
     * @param research
     * @return
     */
    @Override
    public R addOrSave(MbResearch research) {
        if(research.getResId()==null){
            researchDao.insert(research);
        }else{
            researchDao.updateById(research);
        }
        return R.ok();
    }
}
